package cn.tedu.rabbitmqspring.m1;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class Consumer {

    //启动一个消费者 从队列接受消息 并传递给这个方法进行处理
    @RabbitListener(queues = "helloworld")
    public void receive(String msg){
        System.out.println("收到："+ msg);

    }
}
